package com.appleyk.spring.security.config;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>越努力，越幸运</p>
 *
 * @author appleyk
 * @version V.0.1.1
 * @blob https://blog.csdn.net/appleyk
 * @date created on  8:13 下午 2021/1/4
 */
@Configuration
@ComponentScan(basePackages = {"com.appleyk.spring.security"},
excludeFilters = {@ComponentScan.Filter(type= FilterType.ANNOTATION,
value = {Controller.class, RestController.class})})
public class ApplicationConfig implements ApplicationContextAware{

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        System.out.println("IOC容器中的bean个数："+applicationContext.getBeanDefinitionCount());
    }
}
